
{extend name='../../admin/view/table'}
{block name="content"}
<div class="think-box-shadow">
    {include file='cat/index_search'}
    <table id="memberTable" data-url="{:sysuri()}" data-target-search="form.form-search"></table>
</div>
{/block}
{block name='script'}
<script>
    $(function () {
        $('#memberTable').layTable({
            even: true, height: 'full',
            sort: {field: 'sort desc,id asc'},
            cols: [[
                // {checkbox: true},
                {field: 'id', title: 'ID', width: 80, align: 'center'},
                {
                    field: 'avatar', title: '头像',  align: 'center', templet: function (d) {
                        if (!d.avatar) return '-';
                        return layui.laytpl('<div class="headimg headimg-ss shadow-inset margin-0" data-tips-image data-tips-hover data-lazy-src="{{d.avatar}}"></div>').render(d);
                    }
                },
                {field: 'sort', title: '排序'},
                {field: 'nickname', title: '昵称'},
                {field: 'gender_name', title: '性别'},
                {field: 'breed_name', title: '品种'},
                {field: 'birthday', title: '出生日期'},
                {
                    field: 'weight', title: '体重',  templet: function (d) {
                        return d.weight/1000+' kg';
                    }
                },
                {field: 'm_nickname', title: '所属用户', align: 'center'},
                {field: 'mobile', title: '联系电话'},
                {field: 'create_at', title: '添加时间'},
                {toolbar: '#toolbar', title: '操作面板', align: 'center',minWidth: 200, fixed: 'right'}
            ]]
        });
    });

</script>
<script type="text/html" id="toolbar">
   <a class="layui-btn layui-btn-xs layui-btn-normal" data-title="如厕日志查询" data-offset="20" data-iframe='{:url("toilet_select")}?id={{d.id}}'>如厕日志</a>
</script>
{/block}